<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page language="java" import="com.pingancar.creditmanage.pojo.OrderitemPojo"%>
<!doctype html>
<html>
<head>
    <%@include file="common/head.jspf" %>
    <script src="js/jquery.qrcode.min.js"></script>
    <title>订单详情</title>
    <script>
        $(document).ready(function() {
            $("#qrcode").qrcode({
                text: "<c:out value="${order.orderitemid}"/>"
            });
        });
    </script>
</head>
<body id="order-detail">
<nav class="navbar text-nav" role="navigation">
    <a class="pull-left btn-back" href="orderlist"><i class="icon-chevron-left"></i></a>
    <div class="center-block nav-title">订单详情</div>
</nav>
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-offset-1 col-xs-10">
            <h3><c:out value="${order.paservice.shopinfo.name}"/></h3>
            <p>项目：<c:out value="${order.paservice.tag1}"/></p>
            <p>积分：<c:out value="${order.credit}"/></p>
            <p>电话：<c:out value="${order.paservice.shopinfo.con}"/></p>
            <p>地址：<c:out value="${order.paservice.shopinfo.location}"/></p>
            <p>营业时间：<c:out value="${order.paservice.shopinfo.bh}"/></p>
            <p>订单号：<c:out value="${order.orderitemid}"/></p>
        </div>
    </div>

    <% if (((OrderitemPojo)request.getAttribute("order")).getStatus() == OrderitemPojo.ORDERING) { %>
    <div class="row">
        <div class="col-xs-offset-1 col-xs-10">
            <div id="qrcode"></div>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-offset-1 col-xs-10">
            <a class="btn btn-pa-large btn-block" href="rejectorder?id=<c:out value="${order.id}"/>">退单</a>
            <%--<a href="confirmorder?id=<c:out value="${order.id}"/>">确认</a>--%>
        </div>
    </div>
    <% } else if (((OrderitemPojo)request.getAttribute("order")).getStatus() == OrderitemPojo.CONFIRM) { %>
    <div class="row"></div>
    <link type="text/css" href="css/star-rating.min.css" rel="stylesheet">
    <script src="js/star-rating.min.js"></script>
    <script src="js/pages/user/comment.js"></script>
    <form method="post" action="./commentOrder">
        <div class="form-group">
            <input name="rate" id="rate" type="number" class="rating" min=0 max=5 step=1 data-size="lg" data-show-clear="false" data-show-caption="false"/>
            <input name="id" type="hidden" value="<c:out value="${param.id}"/>"/>
        </div>
        <div class="form-group">
        <textarea class="form-control" name="comment" rows="5" placeholder="请留下您的评价"></textarea>
        </div>
        <button class="btn btn-pa-large btn-block" type="submit">评价</button>
    </form>
    <p>&nbsp;</p>
    <% } %>
</div>


</body>
</html>
